package makabakaquestionnaire.zutsoftware.mapper;

import makabakaquestionnaire.zutsoftware.entity.request.QueryProjectRequest;
import makabakaquestionnaire.zutsoftware.entity.UserProject;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface UserProjectMapper {
    List<UserProject> queryAll();
    UserProject queryProjectByProKey(String projectKey);
    /**
     *  <P>根据问卷就状态查询问卷 </p>
     *
     *  @param
     *  @return
     */
    List<UserProject> queryProjectWithStatus(@Param("status")Long status, @Param("username") String username);
    /**
     * 根据UserProject对象的id查询Paper，返回Paper
     *
     * @param id
     * @return
     */
    List<UserProject> queryProjectByUserID(Long id);

    /**
     * 插入一个UserProject对象到数据库中
     *
     */
    int insertProject(UserProject userProject);

    /**
     * 更新问卷
     * @param userProject
     * @return
     */
    int updateProject(UserProject userProject);
    int deleteProject(Long id);
    List<UserProject> queryProjectByRequest(QueryProjectRequest queryProjectRequest);

}
